package com.lxj.easyadapter;

import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * @param <T>
</T> */
public abstract class EasyAdapter<T> extends MultiItemTypeAdapter<T> {
    private int mLayoutId;

    protected abstract void bind(@NotNull ViewHolder holder, T item, int position);

    public EasyAdapter(@NotNull List<T> data, int mLayoutId) {
        super(data);
        this.mLayoutId = mLayoutId;
        this.addItemDelegate(new ItemDelegate<T>() {
            public boolean isThisType(T item, int position) {
                return true;
            }

            public void bind(@NotNull ViewHolder holder, T t, int position) {
                EasyAdapter.this.bind(holder, t, position);
            }

            public int getLayoutId() {
                return mLayoutId;
            }
        });
    }

}
